package auth

import (
	"fmt"
	"testing"
)

func TestHash(t *testing.T) {
	pass := []string{"8sjhkfuhjsasfhoas", "12131sadsadadadada", "dadadf5655aaad"}
	for _, v := range pass {
		r, err := GenerateFromPassword(v)
		fmt.Println(err)
		hp := fmt.Sprintf("%s", r)
		fmt.Println(hp)
		fmt.Println(len(hp))

		err = CompareHashAndPassword(hp, v)
		fmt.Println(err)
		err = CompareHashAndPassword(hp, "12313")
		fmt.Println(err)
	}

}

func TestHashPwd(t *testing.T) {
	pwd := "wzadmin2023"
	hs, err := GenerateFromPassword(pwd)
	if err != nil {
		t.Fatal(err)
	}
	fmt.Println(string(hs))
}
